<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.acme</groupId>
  <artifactId>acme-ldap</artifactId>
  <version>1.0</version>
  <packaging>jar</packaging>

  <name>acme-ldap</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <slf4jVersion>1.5.8</slf4jVersion>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-all</artifactId>
      <version>1.5.7</version>
      <exclusions>
        <!-- shared-ldap-schema module needs to be excluded to avoid multiple schema resources on the classpath-->
        <exclusion>
          <groupId>org.apache.directory.shared</groupId>
          <artifactId>shared-ldap-schema</artifactId>
        </exclusion>
          <exclusion>
              <groupId>org.apache.directory.shared</groupId>
              <artifactId>shared-ldap</artifactId>
          </exclusion>
      </exclusions>
    </dependency>

      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
          <version>${slf4jVersion}</version>
      </dependency>
      <dependency>
          <!-- any library that uses commons-logging will be directed to slf4j -->
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
          <version>${slf4jVersion}</version>
      </dependency>
      <dependency>
          <!-- any library that uses slf4j will be directed to java.util.logging -->
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-jdk14</artifactId>
          <version>${slf4jVersion}</version>
      </dependency>
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-simple</artifactId>
          <version>${slf4jVersion}</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <version>${slf4jVersion}</version>
      </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
         <source>11</source>
         <target>11</target>
         <debug>true</debug>
         <encoding>UTF-8</encoding>
       </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <mainClass>org.acme.Ldap</mainClass> 
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                    <exclude>apacheds-all-1.5.7.jar!/org/apache/directory/shared/ldap/util/SystemUtils.class</exclude>
                                </excludes>
                            </filter>
                        </filters>
            </configuration>
            <!--configuration>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedArtifactAttached>false</shadedArtifactAttached>
            </configuration-->
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
